#if !defined(__METABALLS2D_H__)
#define __METABALLS2D_H__

#include "EdgeVertex.h"

namespace blobDetection
{

//==================================================
//class Metaballs2D
//==================================================
class Metaballs2D
{

protected:
// Isovalue
// ------------------
	float isovalue;

// Grid
// ------------------
	int  resx,resy;
	float stepx,stepy;
	float *gridValue;
	int nbGridValue;  

// Voxels      
// ------------------
	int *voxel;
	int nbVoxel;

// EdgeVertex
// ------------------
	EdgeVertex *edgeVrt;
	int nbEdgeVrt;  

// Lines
// what we pass to the renderer
// ------------------
	int *lineToDraw;  

// getSquareIndex(int,int)
// ------------------
	int getSquareIndex(int x, int y);
	
// Constructor
// ------------------
public:
	Metaballs2D(){}
	~Metaballs2D();

	int nbLineToDraw;

// init(int, int)
// ------------------
	void init(int resx, int resy);

// computeIsovalue()
// ------------------
	void computeIsovalue();

// computeMesh()
// ------------------
	void computeMesh();

// setIsoValue(float)
// ------------------
	void setIsovalue(float iso);


};

}

#endif